<%
var headerPart = {
%>
<style>
	.layui-table-page{
		padding: 7px 0 0;
	}
</style>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
<div class="childrenBody">
	<div class="kit-table">
	<form id="searchForm" action="${ctx}/cms/guestbook/" method="post" class="layui-form layui-card-header layuiadmin-card-header-auto">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">分类：</label>
				<div class="layui-input-block">
					<select id="type" name="type" class="input-medium">
						<option value="" label=""/>
						<#options items="${@DictUtils.getDictList('cms_guestbook')}" value=""/>
					</select>
				</div>
			</div>
		
			<div class="layui-inline">
				<label class="layui-form-label">内容 ：</label>
				<div class="layui-input-block">
					<input type="text" name="content" htmlEscape="false" maxlength="50" class="layui-input"/>
				</div>
			</div>
		
			<div class="layui-inline">
				<label class="layui-form-label">状态</label>
				<div class="layui-input-block">
					<#radio name="delFlag" items="${@DictUtils.getDictList('cms_del_flag')}"  value="${guestbook.delFlag}"/>
				</div>
			</div>
			<div class="layui-inline">
				<button class="layui-btn layuiadmin-btn-useradmin" lay-submit="" lay-filter="LAY-enrollList-search">
					<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
				</button>
			</div>
		</div>
	</form>
	<div class="kit-table-body">
		<table id="contentTable" class="layui-table" >
			<thead>
			<tr>
				<th style="text-align:center">留言分类</th>
				<th style="text-align:center">留言内容</th>
				<th style="text-align:center">留言人</th>
				<th style="text-align:center">留言时间</th>
				<th style="text-align:center">回复人</th>
				<th style="text-align:center">回复内容</th>
				<th style="text-align:center">回复时间</th>
			<%if(shiro.hasPermission("cms:guestbook:edit")){%>
				<th style="text-align:center">操作</th>
			<%}%>
			</tr>
			</thead>
			<tbody>
				<%for(guestbook in page.list){%>
				<tr>
					<td style="text-align:center">${@DictUtils.getDictLabel(guestbook.type, 'cms_guestbook', '无分类')}</td>
					<td style="text-align:center"><a href="${ctx}/cms/guestbook/form?id=${guestbook.id}">${@StringUtils.abbr(guestbook.content,40)}</a></td>
					<td style="text-align:center">${guestbook.name}</td>
					<td style="text-align:center">${guestbook.createDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
					<td style="text-align:center">${guestbook.reUser.name}</td>
					<td style="text-align:center">${@StringUtils.abbr(guestbook.reContent,40)}</td>
					<td style="text-align:center">${guestbook.reDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
					<%if(shiro.hasPermission("cms:guestbook:edit")){%><td>
						<%if(guestbook.delFlag != '2'){%>
							<a class="layui-btn layui-btn-xs" href="${ctx}/cms/guestbook/delete?id=${guestbook.id}${guestbook.delFlag != 0?'&isRe=true':''}"
							onclick="return confirmx('确认要${guestbook.delFlag != 0?'恢复审核':'删除'}该留言吗？', this.href)">${guestbook.delFlag != 0?'恢复审核':'删除'}</a>
						<%}else{%>
							<a class="layui-btn layui-btn-xs" href="${ctx}/cms/guestbook/form?id=${guestbook.id}">审核</a>
						<%}%>
					</td>
					<%}%>
				</tr>
				<%}elsefor{%>
				<tr><td colspan="8" align="center">暂无数据</td></tr>
				<%}%>
			</tbody>
		</table>
		<div class="pagination">${page}</div>
	</div>
	</div>
</div>
<%}%>